package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;

import android.util.Log;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Intent AddBookIntent = new Intent(this,AddBookActivity.class);
        Intent BookListIntent = new Intent(this,BookListActivity.class);
        Intent ConfigureIntent = new Intent(this,ConfigureActivity.class);

        //添加书籍按钮
        Button AddBook = findViewById(R.id.button);
        AddBook.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.d(TAG,"AddBook");
                startActivity(AddBookIntent);
            }
        });

        //书籍清单按钮
        Button BookList = findViewById(R.id.button2);
        BookList.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.d(TAG,"BookList");
                startActivity(BookListIntent);
            }
        });

        Button Configure = findViewById(R.id.ToConfigureActivity);
        Configure.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.d(TAG,"Configure");
                startActivity(ConfigureIntent);
            }
        });
    }

    private static final String TAG =
            MainActivity.class.getSimpleName();

}